package com.xian.service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.xian.dao.OrdersMapper;
import com.xian.pojo.Orders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 *
 */
@Service
@Transactional
public class OrdersServiceImpl implements OrdersService {
    @Autowired
    private OrdersMapper ordersMapper;

    // 分页查询
    public List<Orders> finaAll(int page, int size) {
        // pageNum 是页码值，pageSize 代表每页显示条数
        PageHelper.startPage(page, size);
        return ordersMapper.findAll();
    }

    // 订单详情查询
    public Orders findById(String id) {
        return ordersMapper.findById(id);
    }
}